]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
js: Avoid double declarations with let
authorPhilip Chimento <philip@endlessm.com>
Fri, 10 Feb 2017 02:12:59 +0000 (18:12 -0800)
committerPhilip Chimento <philip.chimento@gmail.com>
Fri, 10 Feb 2017 21:35:50 +0000 (13:35 -0800)
The following code is a syntax error in ES6:

    let a = 'something';
    let a = 'other thing';

Previously GJS would silently accept this code, but in the next release the
SpiderMonkey JS engine will be more ES6-compliant.

https://bugzilla.gnome.org/show_bug.cgi?id=778425

js/misc/keyboardManager.js
js/ui/dateMenu.js
js/ui/endSessionDialog.js
js/ui/notificationDaemon.js

index e8a3e781ec6eb014983b0071899d4375b2633d4e..95afb4a8c0173094d140757d6d52faf07f99437c 100644 (file)
@@ -128,7 +128,8 @@ const KeyboardManager = new Lang.Class({
         if (!found)
             [, , id] = GnomeDesktop.get_input_source_from_locale(DEFAULT_LOCALE);
 
-        let [found, , , _layout, _variant] = this._xkbInfo.get_layout_info(id);
+        let _layout, _variant;
+        [found, , , _layout, _variant] = this._xkbInfo.get_layout_info(id);
         if (found)
             return { layout: _layout, variant: _variant };
         else
index 98c4aa4c3f26c18d288328f3263703281065c3e3..36c79504685bc3ee1d92bd30f24430e4141b55da 100644 (file)
@@ -77,7 +77,7 @@ const TodayButton = new Lang.Class({
          * below the time in the shell; it should combine the weekday and the
          * date, e.g. "Tuesday February 17 2015".
          */
-        let dateFormat = Shell.util_translate_time_string (N_("%A %B %e %Y"));
+        dateFormat = Shell.util_translate_time_string (N_("%A %B %e %Y"));
         this.actor.accessible_name = date.toLocaleFormat(dateFormat);
     }
 });
index 2ec8e04e12097a2b8a6a23f687c05436e06cecee..42977d39419a34700c68737cf5292196c67fd6b6 100644 (file)
@@ -457,7 +457,6 @@ const EndSessionDialog = new Lang.Class({
         _setLabelText(this._descriptionLabel, description);
         _setLabelText(this._subjectLabel, subject);
 
-        let dialogContent = DialogContent[this._type];
         if (dialogContent.iconName) {
             this._iconBin.child = new St.Icon({ icon_name: dialogContent.iconName,
                                                 icon_size: _DIALOG_ICON_SIZE,
index 24c82b35f395476009cc50cf667bb9c025efda34..623a10fed032c8d6623817c531bb425c88a93440 100644 (file)
@@ -186,7 +186,7 @@ const FdoNotificationDaemon = new Lang.Class({
             return source;
         }
 
-        let source = new FdoNotificationDaemonSource(title, pid, sender, ndata ? ndata.hints['desktop-entry'] : null);
+        source = new FdoNotificationDaemonSource(title, pid, sender, ndata ? ndata.hints['desktop-entry'] : null);
 
         this._sources.push(source);
         source.connect('destroy', Lang.bind(this, function() {